#include <iostream>
using namespace std;
#include "../include/tester.h"
#include "../include/base_util.h"

int point_heap_test(){
    // 执行一些简单的操作测试硬件可以正常使用
    // 新建简单变量
    int a = 1;
    int *p = &a;
    target_sys_call(NULL, a);
    target_sys_call(NULL, *p);
    cout << "a = " << a << endl;
    cout << "p = " << *p << endl;
    
    // 新建数组 堆上数组
    int *arr = new int[10];
    for (int i = 0; i < 10; i++)
    {
        arr[i] = i;
    }
    target_sys_call(NULL, arr[0]);
    target_sys_call(NULL, arr[1]);
    target_sys_call(NULL, arr[6]);

    int *p_arr_obj = &arr[5];
    target_sys_call(NULL, *(p_arr_obj+1));

    // 新建数组 栈上数组
    int arr2[10];
    for (int i = 0; i < 10; i++)
    {
        arr2[i] = i;
    }
    target_sys_call(NULL, arr2[0]);
    target_sys_call(NULL, arr2[1]);
    target_sys_call(NULL, arr2[6]);

    int *p_arr_obj2 = &arr2[5];
    target_sys_call(NULL, *(p_arr_obj2+1));


    return 1;
}